package org.onionframework.persistence.dao.processor;


import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;
import org.onionframework.persistence.dao.CriteriaBuilder;
import org.onionframework.persistence.dao.PropertyFilterProcessor;

public class IEqProcessor implements PropertyFilterProcessor {

	@Override
	public Criterion buildCriterion(String alias, String name, Object value,
			CriteriaBuilder context) {
		if (value == null)
			return Restrictions.isNull(alias);
		else
			return Restrictions.eq(alias, value).ignoreCase();
	}

}
